project(rnapp)
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
set(OH_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp")
set(LOG_VERBOSITY_LEVEL 1)
add_compile_options("-Wno-error=unused-command-line-argument")
set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")

add_subdirectory("${RNOH_CPP_DIR}" ./rn)

# RNOH_BEGIN: manual_package_linking_1
add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-linear-gradient/src/main/cpp" ./linear-gradient)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-flash-list/src/main/cpp" ./flash-list)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-pager-view/src/main/cpp" ./pager_view)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-safe-area/src/main/cpp" ./safe-area)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-smart-refresh-layout/src/main/cpp" ./smart-refresh-layout)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-masked-view/src/main/cpp" ./masked-view)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-fast-image/src/main/cpp" ./fast-image)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-webview/src/main/cpp" ./webview)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-datetimepicker/src/main/cpp" ./datetimepicker)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-lottie/src/main/cpp" ./lottie)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-svg/src/main/cpp" ./svg)
#add_subdirectory("${OH_MODULE_DIR}/rnoh-video/src/main/cpp" ./video)
add_subdirectory("${OH_MODULE_DIR}/rnoh_clip_path_view/src/main/cpp" ./clippath)
# RNOH_END: manual_package_linking_1

file(GLOB GENERATED_CPP_FILES "./generated/*.cpp")

add_library(rnoh_app SHARED
    ${GENERATED_CPP_FILES}
    "./PackageProvider.cpp"
    "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
)
target_link_libraries(rnoh_app PUBLIC rnoh)

# RNOH_BEGIN: manual_package_linking_2
target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
#target_link_libraries(rnoh_app PUBLIC rnoh_linear_gradient)
#target_link_libraries(rnoh_app PUBLIC rnoh_flash_list)
#target_link_libraries(rnoh_app PUBLIC rnoh_pager_view)
#target_link_libraries(rnoh_app PUBLIC rnoh_safe_area)
#target_link_libraries(rnoh_app PUBLIC rnoh_smart_refresh_layout)
#target_link_libraries(rnoh_app PUBLIC rnoh_masked_view)
#target_link_libraries(rnoh_app PUBLIC rnoh_fast_image)
#target_link_libraries(rnoh_app PUBLIC rnoh_webview)
#target_link_libraries(rnoh_app PUBLIC rnoh_datetime_picker)
#target_link_libraries(rnoh_app PUBLIC rnoh_lottie)
#target_link_libraries(rnoh_app PUBLIC rnoh_svg)
#target_link_libraries(rnoh_app PUBLIC rnoh_video)
target_link_libraries(rnoh_app PUBLIC rnoh_clip_path_view)
# RNOH_END: manual_package_linking_2